﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using HA.Data;

using HA.ModFlow.Infrastructure;

namespace HA.ModFlow.Controls.MT3DMSWindows
{
    /// <summary>
    /// winSelectDataSet.xaml 的交互逻辑
    /// </summary>
    public partial class winSelectDataSet : Window
    {
        public winSelectDataSet(List < DSGrid3dCollecion> gridCollection)
        {
            InitializeComponent();

            this._selectDS = new PCSelectDS(gridCollection);

            this.DataContext = this._selectDS;
           

        }


        PCSelectDS _selectDS;

        public PCSelectDS SelectDS
        {
            get { return _selectDS; }
            set { _selectDS = value; }
        }




    
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
           


        }

        private void trViewSolution_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            object obj= trViewSolution.SelectedItem;

            if (obj!=null)
            {
                if (obj is DSGrid3d)
                {
                    DSGrid3d grid=obj as DSGrid3d;

                    lstViewTime.ItemsSource = grid.LstValue;

                    
                }
                
            }
        }



        /// <summary>
        /// 需要返回的具体数据
        /// </summary>
        public CellCenterDataSet3d SelectedDataSet
        {
            get {



                return (CellCenterDataSet3d)lstViewTime.SelectedItem;


            }
        }




        /// <summary>
        /// 需要返回的数据集
        /// </summary>
        public DSGrid3d SelectedDsGrid
        {


            get {

                return trViewSolution.SelectedItem as DSGrid3d;

            }

           
        }





        private void btnOk_Click(object sender, RoutedEventArgs e)
        {




            this.DialogResult = true;

            this.Close();

        }

        private void btnCancal_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void chkAll_Checked(object sender, RoutedEventArgs e)
        {

                lstViewTime.IsEnabled = false;


          

 
          

        }

        private void chkAll_Unchecked(object sender, RoutedEventArgs e)
        {


            lstViewTime.IsEnabled = true;

        }


    }
}
